<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	  "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <title>The deal.II Readme on interfacing to ARPACK</title>
    <link href="../screen.css" rel="StyleSheet">
    <meta name="copyright" content="Copyright (C) 2010 - 2017 by the deal.II authors">
    <meta name="keywords" content="deal.II">
  </head>
  <body>


    <h2>Installation of <acronym>ARPACK</acronym></h2>

    <p>
      <a href="http://www.caam.rice.edu/software/ARPACK/">ARPACK</a>
      is a collection of Fortran77 subroutines designed to solve large
      scale eigenvalue problems.
      <a href="http://www.caam.rice.edu/software/ARPACK/" target="_top">ARPACK</a>
      should be readily packaged by most Linux distributions.
      Don't forget to install a development version of the library.
    </p>

    <p>
      Since <acronym>ARPACK</acronym> has not been maintained by Rice university for some years, Debian,
      Octave and Scilab developers gathered their
      <a href="https://github.com/opencollab/arpack-ng/blob/master/CHANGES">own modifications and bug fixes</a>
      in the library <a href="https://github.com/opencollab/arpack-ng">ARPACK-NG</a>.
      Furthermore, <acronym>ARPACK-NG</acronym> equips <acronym>ARPACK</acronym> with a CMake build system.
    </p>

    <p>
      Below is a short summary of instructions on how to compile and install
      <acronym>ARPACK</acronym> or <acronym>ARPACK-NG</acronym> by hand
      (for the case you wish to do so).
    </p>

    <h3>How to compile and install <acronym>ARPACK</acronym> by hand</h3>

    <p>
      After you downloaded the Fortran version of <acronym>ARPACK</acronym>
      and the patch, unzip the files you got. That will create
      a directory named <acronym>ARPACK</acronym>. If you need
      further instructions please read the README file or the
      <a href="http://www.caam.rice.edu/software/ARPACK/SRC/instruction.arpack">instructions</a>.
      We will explain here in a few steps what has to be done to be able
      to compile <acronym>ARPACK</acronym>.
    </p>

    <ul>
      <li>edit <code>ARmake.inc</code></li>
      <ul>
        <li>change home to the correct directory</li>
        <li>choose which <acronym>BLAS</acronym> and
        <acronym>LAPACK</acronym> you would like to use</li>
      </ul>
      <li>change the file second.f in the UTIL directory</li>
      <li>do <code>make lib</code> in the current directory
      to build the standard library <code>libarpack_$(PLAT).a</code>
      </li>
    </ul>

    <p>
      Note: For compilation of <acronym>ARPACK</acronym> we emphasize
      adding the compiler flag <code>-fPIC</code>. This is a definite
      requirement if we are compiling <acronym>deal.II</acronym> with
      shared libraries (which is the default). If we had preferred to be
      compiling <acronym>deal.II</acronym> without shared libraries,
      that's ok too; in that case we would do exactly the same thing
      as described above, but this time omitting
      the <code>-fPIC</code> flag from the scheme.
    </p>

    <p>
      Try to run one of the examples and compare the output.
      How the output should look like is stated in the README
      that can be found in the <code>EXAMPLES</code> directory.
    </p>

    <p>
      If that output you produced looks like it should you can
      proceed to compile <acronym>deal.II</acronym> with
      <acronym>ARPACK</acronym>.
    </p>

    <h3>How to compile and install <acronym>ARPACK-NG</acronym></h3>

    <p>
      First clone the <a href="https://github.com/opencollab/arpack-ng">ARPACK-NG</a>
      repository. The following commands will set up an appropriate configuration:

      <pre>
        cd arpack-ng
        mkdir build
        cd build

        cmake                                       \
        -DEXAMPLES=ON                               \
        -DMPI=ON                                    \
        -DBUILD_SHARED_LIBS=ON                      \
        -DCMAKE_INSTALL_PREFIX:PATH=$HOME/ARPACK-NG \
        ../

        make
      </pre>

      You will need to adjust the path into which you want to install ARPACK-NG
      in the CMAKE_INSTALL_PREFIX line. If you do not have MPI installed, you
      should use <code>-DMPI=OFF</code> instead.
    </p>

    <p>
      Afterwards run
      <pre>
        make check
        make test
        make install
      </pre>
      to test that the build of <acronym>ARPACK-NG</acronym> works correctly
      and to install the library finally.
    </p>

    <h2>Interfacing <acronym>deal.II</acronym>
      to <acronym>ARPACK</acronym></h2>

    <p>
      Support for <acronym>ARPACK</acronym> will be
      enabled automatically if a system wide installation of
      <acronym>ARPACK</acronym> can be found.
      To use a self compiled version, specify
      <pre>

    -DARPACK_DIR=/path/to/arpack
      </pre>
      when invoking <code>cmake</code>.
    </p>
    <p>
      You can override the autodetection by manually setting
      <pre>

    -DDEAL_II_WITH_ARPACK=OFF|ON
      </pre>.
    </p>

    <hr />
    <div class="right">
      <a href="http://validator.w3.org/check?uri=referer" target="_top">
        <img style="border:0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
      <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_top">
        <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
    </div>

  </body>
</html>
